package cn.com.pxto.client;

import java.io.IOException;

import org.apache.commons.httpclient.HttpConnection;
import org.apache.commons.httpclient.params.HttpConnectionParams;

public class FirstConnection {
	private static  String URL="127.0.0.1";
	private static int PORT=80;
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		HttpConnection connection =new HttpConnection(URL,PORT);
		
		HttpConnectionParams params=new HttpConnectionParams();
		params.setParameter("cmdId", new Integer(1));
		connection.setParams(params);
		/*connection.setVirtualHost("/pxto/service");*/
		String info="Success!";
		try {
			connection.open();
		} catch (IOException e) {
			e.printStackTrace();
			info="fail!";
		}
		
		System.out.println(info);
/*		Object o1=connection.getParams();
		Object o2=connection.getProtocol();
		Object o3=connection.getVirtualHost();*/
	}

}
